import time

from selenium.webdriver.common.by import By

from base.BasePage import BasePage
from common.Tools import Tools
from page.admin.AdminLoginPage import AdminLoginPage


class AdminMallPage(BasePage):
    def __init__(self,driver):
        super().__init__(driver)


    #  进入商品列表界面
    def go_to_goods_list(self):
        self.find_ele((By.LINK_TEXT, "商城")).click()
        self.find_ele((By.LINK_TEXT, "商品列表")).click()




if __name__ == '__main__':
    driver = Tools.web_driver()
    driver.get("http://hmshop-test.itheima.net/admin")
    admin_login = AdminLoginPage()
    admin_login.login("admin", "HM_2025_test", 8888)
    admin_mall = AdminMallPage()
    admin_mall.go_to_goods_list()
    time.sleep(2)
    driver.quit()